import Vue from 'vue'
import Vuex from "vuex"

Vue.use(Vuex);

const store = new Vuex.Store({
	state: {
		userInfo: {},//用户信息
		username: "1",//用户名字
		identity:false, //实名认证
		money: '',
		choose: false,
		chooseFx: false,
		okPay: false,
		currentDetail: {
			buyMin: 100,
			buyRate: 0,
			buySourceRate: 0,
			code: "310338",
			company: null,
			dateOfEstablishment: null,
			fundScale: "11.16亿",
			id: 49,
			lastMonthGrowth: "0.15",
			lastSixMonthsGrowth: "0.9",
			lastThreeMonthsGrowth: "0.46",
			lastYearGrowth: "1.85",
			manager: "叶瑜珍",
			millionCopiesIncome: "0.4741",
			millionCopiesIncomeData: null,
			name: "申万菱信收益宝货币A",
			payType: "活期",
			riskLevel: "L",
			sevenDaysYearIncome: 2.156,
			sevenDaysYearIncomeData: null,
			status: 1,
			totalScale: null,
			type: "货币型",
		},
		bankID: ''
	},
	mutations: {
		CHANGE_DATA(state, payload) {
			state.currentDetail = payload
			console.log(`接到的值=======`, payload.code);
		},
		CHANG_MONEY(state, payload) {
			state.money = payload
		},
		CHANG_CHOOSE(state, payload) {
			state.choose = payload
		},
		CHANG_CHOOSEFX(state, payload) {
			state.chooseFx = payload
		},
		CHANG_OKPAY(state, payload) {
			state.okPay = payload
		},
		CHANGE_BANK(state, payload) {
			state.bankID = payload
		}

	},
	modules: {

	}
})

export default store

